package cn.cvs.service.impl;

import cn.cvs.mapper.sysUser.SysUserMapper;
import cn.cvs.pojo.SysUser;
import cn.cvs.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author: 邓必宏
 * @title:
 * @Demo:
 * @DateTime: 2023/10/18
 */

@Transactional
@Service("sysUserService")
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    SysUserMapper sysUserMapper;

    @Override
    public int getCount(int roleId, String realName) {

        return sysUserMapper.getCount ( roleId, realName );
    }

    @Override
    public List<SysUser> getUserListByRoleIdAndRealName(int roleId, String realName, int pageSize, int pageNo) {
        return sysUserMapper.getUserListByRoleIdAndRealName ( roleId, realName, pageSize, pageNo );
    }

    @Override
    public int updateUser(SysUser user) {
        return sysUserMapper.updateUser ( user );
    }

    @Override
    public int deleteUser(List<Integer> ids) {
        return sysUserMapper.deleteUser ( ids );
    }

    @Override
    public SysUser getUser(int userId) {
        return sysUserMapper.getUser ( userId );
    }

    @Override
    public SysUser getUserByAccountAndPwd(String account, String password) {
        return sysUserMapper.getUserByAccountAndPwd ( account, password );
    }

    @Override
    public int addUser(SysUser user) {
        return sysUserMapper.addUser ( user );
    }

    @Override
    public SysUser getUserByIdAndPwd(Integer id, String password) {
        return sysUserMapper.getUserByIdAndPwd ( id, password );
    }

    public SysUserMapper getSysUserMapper() {
        return sysUserMapper;
    }

    public void setSysUserMapper(SysUserMapper sysUserMapper) {
        this.sysUserMapper = sysUserMapper;
    }
}
